package com.car.order.client;

import com.car.commons.core.model.Result;
import com.car.order.client.model.account.admin.AdminDto;
import com.car.order.client.model.account.user.UserDto;
import com.car.order.client.model.clerk.ClerkDto;
import com.car.order.client.model.stores.StoresDto;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Set;

@FeignClient(name = "car-account", path = "/account")
public interface CarAccountClient {
    /**
     * 通过用户id返回一个用户dto
     *
     * @param userId
     * @return
     * @throws Exception
     */
    @GetMapping("/user/findUserById/{userId}.ty")
    public Result<UserDto> findUserById(@PathVariable("userId") Integer userId) throws Exception;

    /**
     * 通过门店id返回一个门店dto
     *
     * @param storesId
     * @return
     * @throws Exception
     */
    @GetMapping("/storesInfo/findStoresById/{storesId}.ty")
    Result<StoresDto> findStoresById(@PathVariable("storesId") Integer storesId);

    /**
     * @return 返回所有状态正常的门店的id
     * @throws Exception
     */
    @GetMapping("/storesInfo/getAllStoresId.ty")
    Result<List<Integer>> getAllStoresId();


    /**
     * 通过门店管理员id的set集合，返回门店管理员dto的list集合
     *
     * @param clerkIds
     * @return
     */
    @GetMapping("/stores/findsClerksByIds.ty")
    Result<List<ClerkDto>> findsClerksByIds(@RequestParam("clerkIds") Set<Integer> clerkIds);

    /**
     * 通过平台管理员id的set集合，返回平台管理员dto的list集合
     *
     * @param adminIds
     * @return
     */
    @GetMapping("/admin/adminsByIds.ty")
    Result<List<AdminDto>> findsAdminByIds(@RequestParam("adminIds") Set<Integer> adminIds);


    /**
     * 修改门店评分
     * @param score
     * @return
     */
    @GetMapping("/storesInfo/changeStoresInfoScore.ty")
    Result changeStoresInfoScore(@RequestParam("score") Integer score,@RequestParam("storesId") Integer storesId);


    @GetMapping("/stores/ById.ty")
    public Result<ClerkDto> findClerkById(@RequestParam("clerkId") Integer clerkId);
}
